package com.coderdream.chapter10.strategy.a4a;

public class SorterAndPoint {
	Comparable[] data;
	Sorter sorter;
	
	public SorterAndPoint(Comparable[] data, Sorter sorter) {
		this.data = data;
		this.sorter = sorter;
	}
	
	public void execute() {
		this.print();
		this.sorter.sort(data);
		this.print();
	}
	
	public void print(){ 
		for (int i = 0; i < data.length; i++) {
			System.out.print(data[i] + ", ");
		}
		
		System.out.println("");
	}
}
